"""
    create by IAmFiveHigh on 2023/9/15
"""
from python.list_node import ListNode
from python.solution import Solution

l1 = [1, 2, 3, 4, 5]
l2 = [1, 2]
l3 = []


def test(l, fun):
    node = ListNode.init_with_list(l)
    print(f"翻转前 {node}")
    result = fun(node)
    print(f"翻转后 {result}")


if __name__ == '__main__':
    test(l1, Solution.reverse_list)
    test(l2, Solution.reverse_list)
    test(l3, Solution.reverse_list)

    test(l1, Solution.reverse_list_by_recursion)
    test(l2, Solution.reverse_list_by_recursion)
    test(l3, Solution.reverse_list_by_recursion)